import pygame
from PyPixelCore.Setting import Block_type
"""
    基础的块
    建议继承,不建议直接使用(可以作为空气墙之内的东西使用)
"""


class BaseBlock(pygame.sprite.Sprite):
    def __init__(self, layer=0):
        super().__init__()
        self.image = None
        self._type = Block_type.abstract_block
        self.rect = pygame.Rect(0, 0, 0, 0)
        self.is_show = True  # 用于绘制时参与
        self.is_collision = False
        self.layer = layer
        self.is_dirty = False
        self.user_dict = {}

    def update(self):
        pass

    def draw(self, surf):
        pass

    def set_layer(self, layer):
        self.layer = layer

    @property
    def type(self):
        return self._type
